<template>
  <div>
    <h1>小红书</h1>
    <el-input v-model="inputValue" placeholder="请输入内容" />
    <el-button type="primary" @click="getData">抓取</el-button>
  </div>
</template>
<script setup>
import { ref, onMounted } from "vue";
const inputValue = ref('https://www.baidu.com/')
const getData = async () => {
    window.electronAPI.send('toMain', inputValue.value);
}

onMounted(() => {
  window.electron.ipcRenderer.on('callback', (event, newValue) => {
    console.log(JSON.parse(newValue))  //传递过来的数据
  })
})
</script>